{extend name="public:member" /}
{block name="content"}
<div class="page-header">
	<h1>
		{$breadcrumb1}
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$breadcrumb2}
		</small>	
	</h1>
</div>
<script src="__PUBLIC__/artDialog/artDialog.js"></script>
<script src="__PUBLIC__/artDialog/iframeTools.js"></script>
<link href="__PUBLIC__/artDialog/skins/default.css" rel="stylesheet" type="text/css" />	
	
<table class="table table-striped table-bordered table-hover search-form">
	<thead>
		<th><input name="order_num" type="text" placeholder="输入订单号" value="{:input('param.order_num')}" /></th>
	
		<th>    				
			<select name="status">
				<option value="">-选择状态-</option>
				<?php $search_status=input('param.status'); ?>
				{volist name="status" id="v" }
					<option <?php if($search_status==$v['order_status_id']){echo ' selected="selected"';} ?> value="{$v.order_status_id}">{$v.name}</option>
				{/volist}	
			</select>
		</th>
		<th>
			<a class="btn btn-primary" href="javascript:;" id="search" url="{:url('OrderMember/index')}">查询</a>
		</th>
	</thead>
</table>	
	
<div class="row">
	<div class="col-xs-12">	
		<div class="table-responsive">
			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>											
						
						<th>订单号</th> 
						<th>总计</th> 						
									
						<th>状态</th>	
						<th>下单时间</th>					
						<th>操作</th>	
					</tr>
				</thead>
				<tbody>
						{volist name="list" id="v" empty="$empty"}
						<tr>						
						
							<td>{$v.order_num_alias}
								{if condition="$v['shipping_method'] eq ''"}
								<span style="border:1px solid red;color:#f60;">免运输</span>
								{/if}
							</td>	
							<td>
								￥{$v.total}
							</td>						
							
							<td id="upay{$v.order_id}">{$v.name}
								{if condition="$v['order_status_id'] eq config('default_order_status_id')"}
								 / <a order_id="{$v.order_id}" id="pay{$v.order_id}" class="re_pay">去支付</a> / <a class="delete" href="{:url('OrderMember/cancel',array('id'=>$v['order_id']))}">取消订单</a>
								{/if}
								</td>
							<td>
								{$v.date_added|date="Y-m-d H:i:s",###}								
							</td>
							<td>
								<a  class="btn btn-xs btn-info" href='{:url("OrderMember/show_order",array("id"=>$v["order_id"]))}'>
									<i class="fa fa-eye bigger-120"></i>
								</a> 
							
								
							</td>
						</tr>
						{/volist}	
						
						<tr>
							<td colspan="20" class="page">{$list->render()}</td>
						</tr>
				</tbody>
				
			</table>
		</div>
	</div>
</div>
{/block}
{block name="javascript"}
<script>	
$(function(){
   $("#search").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });	
    
    $('.re_pay').click(function(){
		
		var order_id=$(this).attr('order_id');
		
		var url="{:url('Payment/Payment/choice_payment_type')}"+"/order_id/"+order_id;
		
		art.dialog.open(url, {
						id:'apply',
						title: '去付款',
						lock: true
		});
	});
    
});
</script>
{/block}